from flask import request
from flask_restful import Resource
from controllers.robot.wraps import hmac_verify
from services.robot.agent_service import AgentService
from flask_babel import _
from controllers.robot import api
class RobotsLoginApi(Resource):
    @hmac_verify
    def get(self,robot_id:str):
        robot_remote_ip = request.args.get("remote_ip","Unknown")
        return AgentService.remote_robot_login(robot_id,robot_remote_ip)
    
api.add_resource(RobotsLoginApi, '/login/<string:robot_id>')